//
//  KLSGLoginViewController.m
//  KaoLaShiGuangFM
//
//  Created by lanou3g on 15/11/3.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "KLSGLoginViewController.h"
#import "KLSGRegisterViewController.h"
@interface KLSGLoginViewController ()

@property (nonatomic, strong) UITextField *userTF;
@property (nonatomic, strong) UITextField *passwordTF;
@property (nonatomic, strong) UIButton *loginButton;
@end

@implementation KLSGLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor lightGrayColor];
    // Do any additional setup after loading the view.
    [self addSubViews];
}

- (void)setNavigationBar
{
    self.navigationItem.title = @"登陆";
    UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:(UIBarButtonItemStylePlain) target:self action:@selector(actionRegister)];
    self.navigationItem.rightBarButtonItem = right;
}
//  跳转注册界面
- (void)actionRegister
{
    KLSGRegisterViewController *registerVC = [[KLSGRegisterViewController alloc] init];
    [self.navigationController pushViewController:registerVC animated:YES];
}

- (void)addSubViews
{
    self.userTF = [[UITextField alloc] initWithFrame:CGRectMake((kScreenWidth - (kScreenWidth - 100)) / 2, 100, kScreenWidth - 100, 50)];
    self.userTF.backgroundColor = [UIColor whiteColor];
    self.userTF.placeholder = @"账号";
    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 50)];
    leftView.backgroundColor = [UIColor redColor];
    self.userTF.leftView = leftView;
    self.userTF.leftViewMode = UITextFieldViewModeAlways;
    [self.view addSubview:self.userTF];
    
//    self.passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(50, 200, kScreenWidth - 100, 50)];
//    self.passwordTF.placeholder = @"密码";
//    self.passwordTF.leftView = leftView;
////    self.passwordTF.leftViewMode = UITextFieldViewModeAlways;
//    [self.view addSubview:self.passwordTF];
    
    self.passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(50, 200, kScreenWidth - 100, 50)];
    self.passwordTF.backgroundColor = [UIColor whiteColor];
    self.passwordTF.placeholder = @"账号yy";
    UIView *leftView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 50)];
    leftView1.backgroundColor = [UIColor redColor];
    self.passwordTF.leftView = leftView1;
    self.passwordTF.leftViewMode = UITextFieldViewModeAlways;
    [self.view addSubview:self.passwordTF];

    
    
    self.loginButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
